#include <iostream>
#include<string>
using namespace std;

int main() {
    string s;
    getline(cin, s);
    int len = s.size();
    int ret = s.rfind(' ', len - 1);
    cout << len - ret - 1 << endl;
    return 0;
}